home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / Tools / Mesa-1.2.1 / include / GL / wmesa.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-07-05  |  2.4 KB  |  105 lines

  1. /* wmesa.h */
  2.  
  3. /*
  4.  * Mesa 3-D graphics library
  5.  * Version:  1.2 beta
  6.  * Copyright (C) 1995  Brian Paul  (brianp@ssec.wisc.edu)
  7.  *
  8.  * This library is free software; you can redistribute it and/or
  9.  * modify it under the terms of the GNU Library General Public
  10.  * License as published by the Free Software Foundation; either
  11.  * version 2 of the License, or (at your option) any later version.
  12.  *
  13.  * This library is distributed in the hope that it will be useful,
  14.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  16.  * Library General Public License for more details.
  17.  *
  18.  * You should have received a copy of the GNU Library General Public
  19.  * License along with this library; if not, write to the Free
  20.  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  21.  *
  22.  * Windows driver by: Mark E. Peterson (markp@ic.mankato.mn.us)
  23.  *
  24.  */
  25.  
  26. #ifndef WMESA_H
  27. #define WMESA_H
  28.  
  29.  
  30. #ifdef __cplusplus
  31. extern "C" {
  32. #endif
  33.  
  34.  
  35. #include <windows.h>
  36. #include "gl\gl.h"
  37.  
  38.  
  39. /*
  40.  * This is the WMesa context 'handle':
  41.  */
  42. typedef struct wmesa_context *WMesaContext;
  43.  
  44.  
  45.  
  46. /*
  47.  * Create a new WMesaContext for rendering into a window.  You must
  48.  * have already created the window of correct visual type and with an
  49.  * appropriate colormap.
  50.  *
  51.  * Input:
  52.  *         hWnd - Window handle
  53.  *         Pal  - Palette to use
  54.  *         rgb_flag - GL_TRUE = RGB mode,
  55.  *                    GL_FALSE = color index mode
  56.  *         db_flag - GL_TRUE = double-buffered,
  57.  *                   GL_FALSE = single buffered
  58.  *
  59.  * Note: Indexed mode requires double buffering under Windows.
  60.  *
  61.  * Return:  a WMesa_context or NULL if error.
  62.  */
  63. extern WMesaContext WMesaCreateContext(HWND hWnd,HPALETTE Pal,
  64.                                        GLboolean rgb_flag,GLboolean db_flag);
  65.  
  66.  
  67. /*
  68.  * Destroy a rendering context as returned by WMesaCreateContext()
  69.  */
  70. extern void WMesaDestroyContext( WMesaContext ctx );
  71.  
  72.  
  73. /*
  74.  * Make the specified context the current one.
  75.  */
  76. extern void WMesaMakeCurrent( WMesaContext ctx );
  77.  
  78.  
  79. /*
  80.  * Return a handle to the current context.
  81.  */
  82. extern WMesaContext WMesaGetCurrentContext( void );
  83.  
  84.  
  85. /*
  86.  * Swap the front and back buffers for the current context.  No action
  87.  * taken if the context is not double buffered.
  88.  */
  89. extern void WMesaSwapBuffers(void);
  90.  
  91.  
  92.  
  93. // In indexed color mode we need to know when the palette changes.
  94.  
  95. extern void WMesaPaletteChange(HPALETTE Pal);
  96.  
  97.  
  98. #ifdef __cplusplus
  99. }
  100. #endif
  101.  
  102.  
  103. #endif
  104.  
  105.